<template>
  <div class="page">
    <h1>用户导航在这里</h1>
    <nuxt></nuxt>
    <ul>
      <li v-for="(user,index) in users" :key="user.id">
        <span>{{user.name}}</span>
      </li>
    </ul>
  </div>
</template>

<script type="text/ecmascript-6">
function getUsers() {
  return new Promise(resolve => {
    setTimeout(() => {
      resolve([{ name: "tom", id: 1 }, { name: "jerry", id: 2 }]);
    }, 1500);
  });
}
export default {
  layout: "users",
  data() {
    return {};
  },
  //异步请求数据
  async asyncData() {
    const users = await getUsers();
    return { users };
  },
  components: {}
};
</script>

<style scoped>
</style>
